/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-05-08 17:53:06
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-05-20 10:00:05
 * @FilePath: \ken147258.topayClient\src\api\other\pay_product.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ProductVO } from "./types";

const URL = {
  list: '/platformApi/pay_product/list',
  all: '/platformApi/pay_product/all',
  add: '/platformApi/pay_product/add',
  edit: '/platformApi/pay_product/edit',
  setMsProductRate: '/platformApi/pay_product/setMsProductRate', // 直接设置所有码商对应得支付产品的费
  tuneUpMsProductRate: '/platformApi/pay_product/tuneUpMsProductRate', // 原有码商费率得基础上上调或者下调
};

export function list(data: object): AxiosPromise<ProductVO> {
  return request({
    url: URL.list,
    method: "get",
    params: data,
  });
}

export function all(): AxiosPromise<any> {
  return request({
    url: URL.all,
    method: "get",
  });
}

export function add(params): AxiosPromise<any> {
  return request({
    url: URL.add,
    method: "post",
    data: params,
  });
}

export function edit(params): AxiosPromise<any> {
  return request({
    url: URL.edit,
    method: "post",
    data: params,
  });
}

export function setMsProductRate(params): AxiosPromise<any> {
  return request({
    url: URL.setMsProductRate,
    method: "post",
    data: params,
  });
}

export function tuneUpMsProductRate(params): AxiosPromise<any> {
  return request({
    url: URL.tuneUpMsProductRate,
    method: "post",
    data: params,
  });
}
